package com.yaoli.yidong;

import java.util.Arrays;
import java.util.Comparator;
import java.util.PriorityQueue;
import java.util.Scanner;

/**
 * Created by will on 2017/5/13.
 */
public class Tet {

    public static int gcd(int m, int n) {
        while (true) {
            if ((m = m % n) == 0) {
                return n;
            }

            if ((n = n % m) == 0) {
                return m;
            }
        }
    }

    public static void main(String[] args) {
        Scanner in = new Scanner(System.in);

        int len = in.nextInt();

        len = len * 3;

        int [] array = new int[len];

        int z = 0;
        while (len != 0) {//注意while处理多个case
            array[z] = in.nextInt();
            z++;
            len --;
        }

        Arrays.sort(array);

        int count = 0;

        // 1,1,1,1000,1000,1000
        for(int i = array.length - 2; i >= array.length / 3; i = i - 2 ){
            count = count + array[i];
        }

        System.out.println(count);
    }
}
